<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"  pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="stylesheet_1.css">
        <title>Registration</title>
        <style>
            span.error {
                color: red;
            }
        </style>
    </head>

    <body>

        <c:if test="${error != null}">
            <div style="color:#FF0000" align="center">
                <c:out value="${error}"/><br/><br/>
            </div>
        </c:if>
        <h1>
            Register new user<br/><br/>
        </h1>
        <form:form method="POST" action="registerPage.html"  modelAttribute="userForm">
            <table width="70%" border="0" cellspacing="0" cellpadding="3">
                <tr>
                    <td>Login: </td>
                    <td><form:input path="login" type="text" value="${user.login}" /> <font color="red">*</font></td>
                    <td><span class="error"><form:errors path="login" /></span></td>
                </tr>
                <tr>
                    <td>Password: </td>
                    <td><form:input path="password" type="password" value="${user.password}"/> <font color="red">*</font></td>
                    <td><span class="error"><form:errors path="password" /></span></td>
                </tr>
                <tr>
                    <td>Password: </td> 
                    <td><form:input path="passwordConfirm" type="password" value="${user.password}"/> <font color="red">*</font></td>
                    <td><span class="error"><form:errors path="passwordConfirm" /></span></td>
                </tr>
                <tr>
                    <td>Email: </td> 
                    <td><form:input path="email" type="text" value="${user.email} "/> <font color="red">*</font></td>
                    <td><span class="error"><form:errors path="email" /></span></td>
                </tr>
                <tr>
                    <td>First name: </td> 
                    <td><form:input path="firstName" type="text" value="${user.firstName}"/> <font color="red">*</font></td>
                    <td><span class="error"><form:errors path="firstName" /></span></td>
                </tr>
                <tr>
                    <td>Last name: </td> 
                    <td><form:input path="lastName" type="text" value="${user.lastName}"/> <font color="red">*</font></td>
                    <td><span class="error"><form:errors path="lastName" /></span></td>
                </tr>
                <tr>
                    <td>Birthday: </td> 
                    <td><form:input path="birthday" type="text" placeholder='yyyy-MM-dd' value="${user.birthday}"/> <font color="red">*</font></td> 
                    <td><span class="error"><form:errors path="birthday" /></span></td>
                </tr>
                <tr>
                    <td  colspan="3">

                        <script type="text/javascript">
                            var RecaptchaOptions = {
                                theme: 'white'
                            };
                        </script>
                        <script type="text/javascript"
                                src="http://www.google.com/recaptcha/api/challenge?k=6Ler_-USAAAAAC3bz06b-QXXm59P56JyFbxBh_Ln">
                        </script>

                        <noscript>
                            <iframe src="http://www.google.com/recaptcha/api/noscript?k=6Ler_-USAAAAAC3bz06b-QXXm59P56JyFbxBh_Ln"
                                    height="300" width="500" frameborder="0"></iframe><br>
                            <textarea name="recaptcha_challenge_field" rows="3" cols="40">
                            </textarea>
                            <input type="hidden" name="recaptcha_response_field" value="manual_challenge">
                        </noscript>
                    </td>
                </tr>
                <tr>
                    <td><input type="submit" value="OK"></td>
                    <td><input  type="button" value="Cancel" onclick="javascript:history.back();" /></td>
                <tr/>
            </table>
        </form:form>

    </body>

</html>